/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Iconos;

import CallCenterComunicate.Cliente;
import GuiCallCenter.InformeClientes;
import GuiCallCenter.Login;
import javax.swing.JOptionPane;

/**
 *
 * @author Tecnico-SICE
 */
public class InterfazSupervisor extends javax.swing.JFrame {
 Cliente cli =new Cliente();
   
    
    private void LimpiarPantalla(){
        jTextFieldRutCliente.setText("");
        jLabelNombreCliente.setText("");
        jLabelCiudad.setText("");
        jLabelEmail.setText("");
        jLabelTelefono.setText("");
        jLabelDeudaClienteInfo.setText("");
        jLabelHboHd.setText("");
        jLabelHboPlus.setText("");
        jLabelPlanFutbol.setText("");
        jLabelPlanInfantil.setText("");
        jLabelCantidadDecos.setText(""); 
        jLabelPlanInternet.setText("");
        jLabelPlanTelevision.setText("");
        jLabelPlanVoz.setText("");}
    /**
     * Creates new form NewJFrame
     */
    public InterfazSupervisor() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jCheckBox1 = new javax.swing.JCheckBox();
        jPanel1 = new javax.swing.JPanel();
        jLabelBienvenidoSupervisor = new javax.swing.JLabel();
        jLabelDatosCLiente = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jTextFieldRutCliente = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabelCiudad = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabelEmail = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabelNombreCliente = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabelTelefono = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabelDeudaClienteInfo = new javax.swing.JLabel();
        jLabelDatosServicios = new javax.swing.JLabel();
        jPanelDatosServicios = new javax.swing.JPanel();
        jLabel = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabelAgregaPlan = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabelPlanVoz = new javax.swing.JLabel();
        jLabelPlanInternet = new javax.swing.JLabel();
        jLabelPlanTelevision = new javax.swing.JLabel();
        jLabelCantidadDecos = new javax.swing.JLabel();
        jLabelHboHd = new javax.swing.JLabel();
        jLabelHboPlus = new javax.swing.JLabel();
        jLabelPlanFutbol = new javax.swing.JLabel();
        jLabelPlanInfantil = new javax.swing.JLabel();
        jButtonSolicitud = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        Atras = new javax.swing.JButton();

        jCheckBox1.setText("jCheckBox1");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jLabelBienvenidoSupervisor.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/Supervisor.png"))); // NOI18N
        jLabelBienvenidoSupervisor.setText("Bienvenido Supervisor");
        jPanel1.add(jLabelBienvenidoSupervisor);

        jLabelDatosCLiente.setText("Datos del Cliente");
        jPanel1.add(jLabelDatosCLiente);

        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel1.setText("Rut Cliente");
        jPanel2.add(jLabel1);

        jTextFieldRutCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldRutClienteActionPerformed(evt);
            }
        });
        jPanel2.add(jTextFieldRutCliente);

        jLabel2.setText("Ciudad");
        jPanel2.add(jLabel2);
        jPanel2.add(jLabelCiudad);

        jLabel4.setText("Email");
        jPanel2.add(jLabel4);
        jPanel2.add(jLabelEmail);

        jLabel6.setText("Nombre");
        jPanel2.add(jLabel6);
        jPanel2.add(jLabelNombreCliente);

        jLabel8.setText("Telefono");
        jPanel2.add(jLabel8);
        jPanel2.add(jLabelTelefono);

        jLabel17.setText("¿Cliente con Deuda?");
        jPanel2.add(jLabel17);
        jPanel2.add(jLabelDeudaClienteInfo);

        jPanel1.add(jPanel2);

        jLabelDatosServicios.setText("Datos de servicios");
        jPanel1.add(jLabelDatosServicios);

        jPanelDatosServicios.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel.setText("Plan Voz");
        jPanelDatosServicios.add(jLabel);

        jLabel9.setText("Plan Internet");
        jPanelDatosServicios.add(jLabel9);

        jLabel10.setText("Plan Television");
        jPanelDatosServicios.add(jLabel10);

        jLabel12.setText("HBO HD");
        jPanelDatosServicios.add(jLabel12);

        jLabel13.setText("HBO PLUS");
        jPanelDatosServicios.add(jLabel13);

        jLabelAgregaPlan.setText("Agrega Pack Plan");
        jPanelDatosServicios.add(jLabelAgregaPlan);

        jLabel16.setText("Plan Infantil");
        jPanelDatosServicios.add(jLabel16);

        jLabel14.setText("Plan Futbol");
        jPanelDatosServicios.add(jLabel14);

        jLabel11.setText("Cantidad Decos");
        jPanelDatosServicios.add(jLabel11);
        jPanelDatosServicios.add(jLabelPlanVoz);
        jPanelDatosServicios.add(jLabelPlanInternet);
        jPanelDatosServicios.add(jLabelPlanTelevision);
        jPanelDatosServicios.add(jLabelCantidadDecos);
        jPanelDatosServicios.add(jLabelHboHd);
        jPanelDatosServicios.add(jLabelHboPlus);

        jLabelPlanFutbol.setText("plan futbol");
        jPanelDatosServicios.add(jLabelPlanFutbol);
        jPanelDatosServicios.add(jLabelPlanInfantil);

        jPanel1.add(jPanelDatosServicios);

        jButtonSolicitud.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/user-search-icon.png"))); // NOI18N
        jButtonSolicitud.setText("Solicitud Cliente");
        jButtonSolicitud.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonSolicitudActionPerformed(evt);
            }
        });
        jPanel1.add(jButtonSolicitud);

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/Document-Copy-icon.png"))); // NOI18N
        jButton1.setText("Solicitar Informe");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jPanel1.add(jButton1);

        Atras.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/Bookmark-delete-icon.png"))); // NOI18N
        Atras.setText("Salir");
        Atras.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AtrasActionPerformed(evt);
            }
        });
        jPanel1.add(Atras);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(321, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jTextFieldRutClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldRutClienteActionPerformed
        // TODO add your handling code here:
        
        //hola
    }//GEN-LAST:event_jTextFieldRutClienteActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
         InformeClientes I=new InformeClientes();
                    I.show();
                    hide();
    }//GEN-LAST:event_jButton1ActionPerformed

                                   

    private void AtrasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AtrasActionPerformed
        // TODO add your handling code here:
   
        Login A=new Login();
        A.show();
        hide();
    }//GEN-LAST:event_AtrasActionPerformed


    private void jButtonSolicitudActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSolicitudActionPerformed
   cli=cli.buscar(jTextFieldRutCliente.getText());
        if (cli!=null){
        jLabelNombreCliente.setText(cli.getNombre());
        jLabelCiudad.setText(cli.getNombre());
        jLabelTelefono.setText(cli.getTelefono());
        jLabelEmail.setText(cli.getEmail());
        jLabelDeudaClienteInfo.setText(cli.getDeuda());
        jLabelPlanVoz.setText(cli.getVoz());
        jLabelPlanInternet.setText(cli.getInternet());
        jLabelPlanTelevision.setText(cli.getTv());
        jLabelCantidadDecos.setText(String.valueOf(cli.getDeco()));
        jLabelHboHd.setText(cli.getHboHd());
        jLabelHboPlus.setText(cli.getHboPlus());
        jLabelPlanInfantil.setText(cli.getPlanInfantil());
        jLabelPlanFutbol.setText(cli.getPlanFutbol());
        
        

            }else {
            JOptionPane.showMessageDialog(this,"Usuario No Encontrado");
            LimpiarPantalla();
        }
        // TODO add your handling code here:
    }//GEN-LAST:event_jButtonSolicitudActionPerformed

    private void jButtonLimpiarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonLimpiarActionPerformed
        // TODO add your handling code here:
        LimpiarPantalla();
    }//GEN-LAST:event_jButtonLimpiarActionPerformed


    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(InterfazSupervisor.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(InterfazSupervisor.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(InterfazSupervisor.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(InterfazSupervisor.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new InterfazSupervisor().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Atras;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButtonSolicitud;
    private javax.swing.JCheckBox jCheckBox1;
    private javax.swing.JLabel jLabel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabelAgregaPlan;
    private javax.swing.JLabel jLabelBienvenidoSupervisor;
    private javax.swing.JLabel jLabelCantidadDecos;
    private javax.swing.JLabel jLabelCiudad;
    private javax.swing.JLabel jLabelDatosCLiente;
    private javax.swing.JLabel jLabelDatosServicios;
    private javax.swing.JLabel jLabelDeudaClienteInfo;
    private javax.swing.JLabel jLabelEmail;
    private javax.swing.JLabel jLabelHboHd;
    private javax.swing.JLabel jLabelHboPlus;
    private javax.swing.JLabel jLabelNombreCliente;
    private javax.swing.JLabel jLabelPlanFutbol;
    private javax.swing.JLabel jLabelPlanInfantil;
    private javax.swing.JLabel jLabelPlanInternet;
    private javax.swing.JLabel jLabelPlanTelevision;
    private javax.swing.JLabel jLabelPlanVoz;
    private javax.swing.JLabel jLabelTelefono;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanelDatosServicios;
    private javax.swing.JTextField jTextFieldRutCliente;
    // End of variables declaration//GEN-END:variables
}
